package com.bestv.search.common.util;

public class QueryStringProcess {

    public static String replaceAllIllegleChar(String queryString) {
        String result = queryString.replaceAll("\\\\\"", "###&&&").replaceAll(":", "\\\\:").replaceAll("\"", "\\\\\"")
                .replaceAll("\\u005B", "\\\\[").replaceAll("]", "\\\\]").replaceAll("\\u0028", "\\\\(")
                .replaceAll("\\u0029", "\\\\)").replaceAll("\\u007B", "\\\\{").replaceAll("}", "\\\\}")
                .replaceAll("###&&&", "\\\\\"").replaceAll("!", "\\\\!");
        return result;
    }

    public static void main(String[] args) {
        // \u0022 " \u0027 ' \u0029 (
        String s = "dfa\\\"";
        System.out.println(replaceAllIllegleChar(s));
    }
}
